function formatTime(date) {
  var year = date.getFullYear()
  var month = date.getMonth() + 1
  var day = date.getDate()

  var hour = date.getHours()
  var minute = date.getMinutes()
  var second = date.getSeconds()


  return [year, month, day].map(formatNumber).join('/') + ' ' + [hour, minute, second].map(formatNumber).join(':')
}

function formatNumber(n) {
  n = n.toString()
  return n[1] ? n : '0' + n
}

//拒绝授权
function refusedAuth() {
  console.log("拒绝授权");
  return true;

  // wx.showModal({
  //   title: '不能获取用户信息',
  //   content: '马上设置？',
  //   success: function (res) {
  //     if (res.confirm) {
  //       if (wx.openSetting) {
  //         wx.openSetting();
  //       } else {
  //         wx.showModal({
  //           title: '提示',
  //           content: '当前微信版本过低，无法调用设置功能。'
  //         })
  //       }
  //     } else if (res.cancel) {
        
  //     }
  //   }
  // });
}

module.exports = {
  formatTime: formatTime,
  refusedAuth: refusedAuth,
}
